<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {	
    
    private $Default;
    public function __construct() {
        parent::__construct();
         $this->load->helper(array('url', 'text'));
         //$this->load->model('Nkdefault', 'default');
    }

	public function index()
	{     
	    $this->load->model('Nkdefault', 'default');
        $this->load->model('admin/managebaiviet', 'baiviet');
        $this->load->model('admin/managethongbao', 'thongbao');
	    $temp['title']="Nha khoa Toàn Mỹ - Địa chỉ tin cậy chăm sóc răng của bạn";
        $temp['template']='home';
        $temp['data']['info']="Trang chủ";
        $temp['danhmuc']['menu'] = $this->default->loadDanhMuc();
        $temp['danhmuc']['currentItem'] = 'trangchu';
        $temp['online'] = $this->useronline->countOnline();
        //load 6 bai dich vu
        $where = array('madanhmuc_cha' => 'dichvu', 'hienthitrangchu' => '1');
        $content = $this->baiviet->LoadBaiViet($where, null, true, 6, 0);
        if(!empty($content)) $temp['baiviet'] = $content->result_array(); 
        //load thong bao
        $thongbao = $this->thongbao->LoadThongBao(null, null, 1, 0);
        if(!empty($thongbao)) $temp['thongbao'] = $thongbao->result_array();        
        $this->load->view("template/layout",$temp);	 
	}
}